//连接数据的工具类
//1 引入mongoose的模块
var mongoose = require('mongoose');
//2 连接本地数据库
mongoose.connect('mongodb://localhost:27017/star', {}, (e) => {
  if (e) {
    console.log(e);
    console.log("连接失败");
    return;
  }
  console.log("数据连接成功");
});
//导出mongoose
module.exports = mongoose;
